package chapter_six.text67_4.builder;

import chapter_six.text67_4.bean.Computer;

/**
 * Data time:2021/9/27 15:05
 * StudentID:2019112118
 * Author:hgw
 * Description: 电脑建造者，充当抽象建造者
 */
public abstract class ComputerBuilder {

    protected Computer computer = new Computer();

    public abstract void buildCpu();
    public abstract void buildMemory();
    public abstract void buildHardDisk();
    public abstract void buildHost();
    public abstract void buildMonitor();

    //钩子方法
    public boolean isMonitor(){
        return true;
    }

    //工厂方法，返回一个完整的整体电脑角色对象
    public Computer createComputer() {
        return computer;
    }
}
